package com.youkeyi.ddy.cloud.application.system.configuration;

import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * WxMaConfiguration
 *
 * @Author liuxiawang
 * @Date 2/16/23 12:02 PM
 * @Location shenzhen.china
 */
@Configuration
public class WxMaConfiguration {

    private static final String appId = "wx0411fb6a82e1551d";
    private static final String secret = "832bff3fb574a945026e564555310f35";
    private static final String msgDataFormat = "JSON";

    @Bean
    public WxMaService wxMaService() {
        WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
        config.setAppid(appId);
        config.setSecret(secret);
        config.setMsgDataFormat(msgDataFormat);

        WxMaService service = new WxMaServiceImpl();
        service.setWxMaConfig(config);
        return service;
    }

}
